# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Bruce Zhang <zttt183525594@gmail.com>

pkgname=feeluown
pkgver=3.8.9
pkgrel=2
pkgdesc="FeelUOwn Music Player"
arch=('any')
url="https://github.com/feeluown/FeelUOwn"
license=('GPL3')
depends=('python-qasync' 'python-pyqt5' 'mpv' 'python-opengl' 'python-janus' 'python-requests'
         'python-tomlkit' 'python-packaging' 'python-pydantic' 'python-mutagen' 'qt5-svg')
makedepends=('python-setuptools')
checkdepends=('python-pytest-benchmark' 'python-pytest-cov')
optdepends=('feeluown-local' 'feeluown-netease' 'feeluown-kuwo' 'feeluown-qqmusic')
groups=('feeluown-full')
source=("https://pypi.io/packages/source/f/feeluown/feeluown-$pkgver.tar.gz"
        "feeluown.desktop")
sha512sums=('26b737518f13fdfcb79260945d0eb56f532192754ab105ea29662eb737f38b1eb8f4920d18fb195a7b39473d56b7b77e4b83325bf91cd1fbd6efd39dcd5a6ac2'
            '48882f7469c22e5db332663bc1aa8b398b0a10a0c929d4d7e3d7b8b91205d7d3070c5fa295cb9a14f8c352bff57978bfaad167343e0ddc51c92417eda07c8087')

build() {
  cd $pkgname-$pkgver
  python setup.py build
}

check() {
  cd $pkgname-$pkgver
  pytest
}

package() {
  cd $pkgname-$pkgver
  python setup.py install --root="$pkgdir/" --optimize=1 --skip-build
  install -Dm644 feeluown/gui/assets/icons/feeluown.png -t "$pkgdir"/usr/share/icons/hicolor/512x512/apps/
  install -Dm644 "$srcdir"/feeluown.desktop -t "$pkgdir"/usr/share/applications/
}
